import request from '@/config/axios'

// 企业支付记录 VO
export interface CompanyPayRecordVO {
  id: number // 任务编号
  companyId: number // 企业ID
  money: number // 金额
  img: string // 支付凭证
  state: number // 状态：0:已打款 1：已分配积分
}

// 企业支付记录 API
export const CompanyPayRecordApi = {
  // 查询企业支付记录分页
  getCompanyPayRecordPage: async (params: any) => {
    return await request.get({ url: `/dlbz/company-pay-record/page`, params })
  },

  // 查询企业支付记录详情
  getCompanyPayRecord: async (id: number) => {
    return await request.get({ url: `/dlbz/company-pay-record/get?id=` + id })
  },

  // 新增企业支付记录
  createCompanyPayRecord: async (data: CompanyPayRecordVO) => {
    return await request.post({ url: `/dlbz/company-pay-record/create`, data })
  },

  // 修改企业支付记录
  updateCompanyPayRecord: async (data: CompanyPayRecordVO) => {
    return await request.put({ url: `/dlbz/company-pay-record/update`, data })
  },

  // 删除企业支付记录
  deleteCompanyPayRecord: async (id: number) => {
    return await request.delete({ url: `/dlbz/company-pay-record/delete?id=` + id })
  },

  // 导出企业支付记录 Excel
  exportCompanyPayRecord: async (params) => {
    return await request.download({ url: `/dlbz/company-pay-record/export-excel`, params })
  }
}